home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / MATH / NRPAS13 / KSONE.DEM < prev    next >
Text File  |  1991-04-29  |  1KB  |  54 lines

  1. PROGRAM d13r10(input,output);
  2. (* driver for routine KSONE *)
  3. CONST
  4.    npts=1000;
  5.    eps=0.1;
  6. TYPE
  7.    gldarray = ARRAY [1..npts] OF real;
  8.    glsarray = gldarray;
  9. VAR
  10.    glinext,glinextp : integer;
  11.    glma : ARRAY [1..55] OF real;
  12.    gliset : integer;
  13.    glgset : real;
  14.    i,idum,j : integer;
  15.    d,factr,prob,varnce : real;
  16.    data : gldarray;
  17.  
  18. (*$I MODFILE.PAS *)
  19. (*$I SORT.PAS *)
  20.  
  21. (*$I PROBKS.PAS *)
  22.  
  23. (*$I RAN3.PAS *)
  24.  
  25. (*$I GASDEV.PAS *)
  26.  
  27. (*$I ERFCC.PAS *)
  28.  
  29. FUNCTION func(x: real): real;
  30. VAR
  31.    y : real;
  32. BEGIN
  33.    y := x/sqrt(2.0);
  34.    func := 1.0 - erfcc(y)
  35. END;
  36.  
  37. (*$I KSONE.PAS *)
  38.  
  39. BEGIN
  40.    gliset := 0;
  41.    idum := -5;
  42.    writeln('variance ratio':19,'k-s statistic':16,'probability':15);
  43.    writeln;
  44.    FOR i := 1 to 11 DO BEGIN
  45.       varnce := 1.0+(i-1)*eps;
  46.       factr := sqrt(varnce);
  47.       FOR j := 1 to npts DO BEGIN
  48.          data[j] := factr*abs(gasdev(idum))
  49.       END;
  50.       ksone(data,npts,d,prob);
  51.       writeln(varnce:16:6,d:16:6,prob:16:6)
  52.    END
  53. END.
  54.